import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';



void main(){
  runApp(SubordinatesApp());
}

class SubordinatesApp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
      return MaterialApp(
        home: HomePage3(),
      );
  }
}

bool HaveTx = false;
String ImgUrl = '';
class HomePage3 extends StatefulWidget {
  @override
  HomePageState createState() => new HomePageState();
}

class HomePageState extends State<HomePage3>{
  bool HaveTX = false;
  @override
  Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
            automaticallyImplyLeading: false,
            backgroundColor: Color.fromRGBO(51, 51, 51, 1),
            titleSpacing: 0.0,
            title:Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children:<Widget> [
                FlatButton(
                  materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
                  child: Row(
                    children:<Widget> [
                      Icon(Icons.arrow_back_ios,color: Colors.white,),
                      Text('返回',style: TextStyle(color: Colors.white,fontSize: 16),)
                    ],
                  ),
                  onPressed: (){
                    Navigator.pop(context);
                  },
                ),
                Container(child: Row(children: [
                  Text('我的下级',style: TextStyle(fontSize: 16,color: Colors.white,),),
                  SizedBox(width: 25,)
                ],),),
                IconButton(icon: Icon(Icons.more_horiz),color: Colors.white, onPressed: (){})
              ],
            )
        ),
        body: Container(
          color: Color.fromRGBO(204, 204, 204, 0.5),
          child: Column(
            children: <Widget>[
              Container(
                color: Colors.white,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                    children:<Widget>[
                      Container(
                        margin: EdgeInsets.only(top: 20,bottom: 20,),
                        child: Column(
                          crossAxisAlignment:CrossAxisAlignment.center,
                          children: <Widget>[
                            Text("下级总人数"),
                            Text("3",style: TextStyle(fontSize: 36),),
                          ],
                        ),
                      ),//下级总人数
                      SizedBox(
                        width: 1,
                        height: 80,
                        child: DecoratedBox(
                          decoration: BoxDecoration(color: Colors.grey),
                        ),
                      ),
                      Container(
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: <Widget>[
                            Text("累计赚取"),
                            Text("￥6.00",style: TextStyle(fontSize: 36),),
                          ],
                        ),
                      ),//累计赚取
                    ],
                ),
              ),//头部
              SizedBox(height: 15,),
              Container(
                height: 604,
              color: Colors.white,
                child: Column(
                  children: <Widget>[
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: <Widget>[
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                          children: <Widget>[
                            Container(
                              decoration: BoxDecoration(
                                border: Border.all(width: 1),
                                borderRadius: BorderRadius.circular(75),
                              ),
                              width: 40,
                              height: 40,
                              child: Tx(),
                            ),//头像
                            Text("张三"),
                          ],
                        ),//头像
                        Text("共赚取￥3.00"),
                      ],
                    ),
                    Divider(
                    ),
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: <Widget>[
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                          children: <Widget>[
                            Container(
                              decoration: BoxDecoration(
                                border: Border.all(width: 1),
                                borderRadius: BorderRadius.circular(75),
                              ),
                              width: 40,
                              height: 40,
                              child: Tx(),
                            ),//头像
                            Text("李四"),
                          ],
                        ),//头像
                        Text("共赚取￥2.00"),
                      ],
                    ),
                    Divider(
                    ),
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: <Widget>[
                        Row(
                          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                          children: <Widget>[
                            Container(
                              decoration: BoxDecoration(
                                border: Border.all(width: 1),
                                borderRadius: BorderRadius.circular(75),
                              ),
                              width: 40,
                              height: 40,
                              child: Tx(),
                            ),//头像
                            Text("王五"),
                          ],
                        ),//头像
                        Text("共赚取￥1.00 "),
                      ],
                    ),
                    Divider(
                    ),
                  ],
                ),

              ),
            ],
          ),
        ),
      );
  }
}
Tx() {
  if (HaveTx == false) {
    return Center(
      child: Text('头像',textAlign:TextAlign.center,),
    );
  } else {
    return Image.asset(
      ImgUrl,
      fit: BoxFit.fill,
    );
  }
}

